<?php
/**
 * Created by PhpStorm.
 * User: yzapple
 * Date: 2018/1/10
 * Time: 下午5:12
 */
namespace app\index\validate;

use think\Validate;

class Userfamily extends Validate
{

    protected $rule =   [
        'name'  => 'require|max:25',
        'document_num'   => 'require',
        'birth' => 'require',

    ];

    protected $message  =   [
        'name.require' => '姓名必填',
        'name.max'     => '姓名最多不能超过25个字符',
        'document_num.require'   => '证件号必填',
        'birth'        => '出生日期必填',

    ];

    //场景不同场景验证不同的字段
    protected $scene = [
        'add_patient'    => ['name','document_num','birth','phone'],
        'edit_patient' => ['name','document_num','birth','phone'],
    ];
}